package com.yuyou.fn.educational.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.educational.entity.Period;
import com.yuyou.fn.educational.vo.*;
import com.yuyou.fn.platform.permission.DataPermission;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 *
 * Period 表数据服务层接口
 *
 */
public interface IPeriodService extends ISuperService<Period,Long> {


    void saveOrUpdatePeriod(PeriodSaveOrUpdateVo periodSaveOrUpdateVo, List<PeriodSegmentVo> segmentList);


    PeriodVo findPeriodByPeriodId(Long periodId );


    Page<Period> findPeriodForPage(Long areaTeamId, DataPermission dataPermission, int pageNo, int pageSize);


    Period findCurrentPeriod(Long areaTeamId );

    void updateCurrentPeriod(Long periodId);

    Period findPeriodByTime(Long areaTeamId, Date time);

    Period findPrePeriod(Long periodId);

    Period findPrePeriod(Long areaTeamId , Integer periodNo);

    Period findNextPeriod(Long periodId);

    Period findPeriodByAreaTeamIdPeriodName(Long areaTeamId , String periodName);

    List<Period> findNearPeriod(Long areaTeamId , int amount);

    List<Period> findByYearAndAreaTeamId(Long areaTeamId,String year);

    List<Period> findListBeforePeriodId(Long areaTeamId,Long periodId);

    List<Period> findBySequentialId(Long areaTeamId,Long sequentialId);

    List<Period> findByStepId(Long areaTeamId,Long stepId);

    List<Period> findRecentPeriod(Long areaTeamId,int amount);

    List<Period> findPreviousByPeriodId(Long periodId,int amount);

    List<Period> findNextByPeriodId(Long periodId,int amount);

    List<Period> findAllCurrentPeriods();

    List<Period> findByAreaTeamIdsAndNames(List<Long> areaTeamIds,List<String> periodNames);

    List<Period> findByAreaTeamIdsAndBetweenNos(Long areaTeamId,Integer start,Integer end);

    List<Period> findByIdsOrderByPeriodNo(List<Long> periodIds);

    Period findByAreaPeriodNo(Long areaTeamId,Integer periodNo);

    List<Period> findListByAreaTeamId(Long areaTeamId);

    Period findMaxPeriod(long areaTeamId);

    List<PeriodRelativeVo> findPeriodRelativeByPeriodIds(List<Long> periodIds);

    List<Period> findCurrentPeriodsByAreaTeamIds(List<Long> areaTeamIds);


    Map<Long,Period> findPeriodMapByAreaTeamId(long areaTeamId);

    PeriodSeqStepSituationVo findPeriodSeqStepSituation(List<Long> periodIds);
}